#ifndef TRIANGLEMESH_H
#define TRIANGLEMESH_H

#include <QObject>
#include <QList>

#include "rtobject.h"

class TriangleMesh : public RTObject
{
    Q_OBJECT
    public:
        explicit TriangleMesh(QObject *parent = 0);
        ~TriangleMesh();

        int vertexCount;
        int materialCount;
        int triangleCount;

        float **materials;
        int *materialsN;

        float **vertices;
        int *verticesMaterial;

        int **triangles;

        char fgp;

        //calculated information

        float **vertexNormals;
        float **vertexColors;

        float **triangleNormals;
        float **triangleColors;
        float *triangleAreas;

        QString getType() { return "TRIANGLE_MESH"; }

        virtual void calcBoundingBox();

    protected:
    
        virtual void readContent();

    private:

        void allocateArrays();
};

#endif // TRIANGLEMESH_H
